package wetogether.travelinfo.dao;

import java.sql.SQLException;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import wetogether.travelinfo.vo.TravelCommentVO;
import wetogether.travelinfo.vo.TravelFrVO;
import wetogether.travelinfo.vo.TravelImageVO;
import wetogether.travelinfo.vo.TravelInfoVO;
import wetogether.travelinfo.vo.TravelVacancyVO;

public class DeleteTravelInfoDAOImpl extends SqlMapClientDaoSupport implements DeleteTravelInfoDAO {
	/**
	 * 1. 여행지 삭제 - 여행지에 해당하는 이미지, 숙박, 맛집, 댓글 모두 삭제됨
	 */
	@Override
	public void deleteTravelInfo(String place) throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deleteTravelInfo", place);
	}
	/**
	 * 1-1. 이미지 모두 삭제
	 */
	@Override
	public void deleteTotalPlaceImage(String place) throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deleteTotalPlaceImage",place);
	}
	/**
	 * 1-2. 숙박 모두 삭제
	 */
	@Override
	public void deleteTotalPlaceVacancy(String place) throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deleteTotalPlaceVacancy",place);
	}
	/**
	 * 1-3. 맛집 모두 삭제
	 */
	@Override
	public void deleteTotalPlaceFr(String place) throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deleteTotalPlaceFr",place);
	}
	/**
	 * 1-4. 댓글 모두 삭제
	 */
	@Override
	public void deleteTotalPlaceComment(String place) throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deleteTotalPlaceComment",place);
	}
	/**
	 * 2. 이미지 삭제 - 하나씩
	 */
	@Override
	public void deletePlaceImage(TravelImageVO imgVO) throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deletePlaceImage",imgVO);
	}
	/**
	 * 3. 숙박 삭제 - 하나씩
	 */
	@Override
	public void deletePlaceVacancy(TravelVacancyVO vacancyVO)
			throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deletePlaceVacancy",vacancyVO);	
	}
	/**
	 * 4. 맛집 삭제 - 하나씩
	 */
	@Override
	public void deletePlaceFr(TravelFrVO frVO) throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deletePlaceFr",frVO);
	}
	/**
	 * 5. 공지 삭제 
	 */
	@Override
	public void deletePlaceNotice(TravelInfoVO tVO) throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deletePlaceNotice",tVO);
	}
	/**
	 * 6. 댓글 삭제
	 */
	@Override
	public void deletePlaceComment(TravelCommentVO commentVO)
			throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deletePlaceComment",commentVO);
	}
	/**
	 * 7. 댓글 삭제시 여행정보에 입력했던 추천점수 삭제
	 */
	@Override
	public void deleteTravelInfoRecommend(TravelCommentVO commentVO)
			throws SQLException {
		super.getSqlMapClientTemplate().delete("traveldelete.deleteTravelInfoRecommend",commentVO);
	}
}
